<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>event</title>
    <script type="text/javascript">
        window.onload=function () {
            document.documentElement.onmousedown=function (event) {
                if(window.event){
                    iclientX=window.event.clientX;
                    iclientY=window.event.clientY;
                    iscreenX=window.event.screenX;
                    iscreenY=window.event.screenY;
                    var sstr="";2
                    if(window.event.button===2){
                        sstr="点击了鼠标右键\n";
                    }
                    else {
                        sstr="点击了鼠标左键\n";
                    }
                    sstr+="事件源："+window.event.srcElement+"\n"+"事件名称："+window.event.type+"\n"
                    +"clientx坐标："+iclientX+",clienty坐标："+iclientY+"\n"+"screenx坐标："+iscreenX+",screeny坐标："
                          +iscreenY;
                    alert(sstr);
                }
                else {
                    iclientX=window.event.clientX;
                    iclientY=window.event.clientY;
                    iscreenX=window.event.screenX;
                    iscreenY=window.event.screenY;
                    var sstr="";
                    if(window.event.button===2){
                        sstr="点击了鼠标右键\n";
                    }
                    else {
                        sstr="点击了鼠标左键\n";
                    }
                    sstr+="事件源："+window.event.target+"\n"+"事件名称："+window.event.type+"\n"
                        +"clientx坐标："+iclientX+",clienty坐标："+iclientY+"\n"+"screenx坐标："+iscreenX+",screeny坐标："
                        +iscreenY;
                    alert(sstr);
                }
            }
        }
    </script>
</head>
<body>
<p>在文档中点击。</p>
</body>
</html>